Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface Microsoft.​Extensions.​Options.​IOptionsMonitor<​TOptions>

Assembly: Microsoft.Extensions.Options

Monitors changes on a <typeparamref name="TOptions" /> instance.

Properties

TOptions
CurrentValue
Gets the current <typeparamref name="TOptions" /> instance with the <see cref="F:Microsoft.Extensions.Options.Options.DefaultName" /> .

Methods

TOptions
Get​(string name)
Returns a configured <typeparamref name="TOptions" /> instance with the given <paramref name="name" /> .
Returns The <typeparamref name="TOptions" /> instance that matches the given <paramref name="name" /> .
name The name of the <typeparamref name="TOptions" /> instance. If <see langword="null" /> , <see cref="F:Microsoft.Extensions.Options.Options.DefaultName" /> , which is the empty string, is used.
OnChange​(System.​Action<​TOptions, string> listener)
Registers a listener to be called whenever a named <typeparamref name="TOptions" /> changes.
Returns An <see cref="T:System.IDisposable" /> that should be disposed to stop listening for changes.
listener The action to be invoked when <typeparamref name="TOptions" /> has changed.